do return end

-- Namespace
	local _,mod = ...


-- Object ref
	local RAID_CLASS_COLORS = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS


-- Constants
	local font = {mod.path..'media\\bavaria.ttf',8,'OUTLINEMONOCHROME'}
	
	local c_bar =    {.16,.16,.16}
	local c_barbg =  {.33,.33,.33}
	local c_border = {.07,.07,.07}
	
	local white = { r = 1, g = 1, b = 1 }


-- Helpers
	local function dim(color,perc)
		local r,g,b = color.r,color.g,color.b
		r,g,b = r*perc,g*perc,b*perc
		return r,g,b
	end


-- Base frame
	local focus = mod:UF('focus')
		focus:SetFrameLevel(2)
		focus:SetHeight(70) focus:SetWidth(14)
		focus:SetPoint('TOPLEFT',UIParent,'CENTER',-252,64)
		
		focus:SetScript('OnEnter',function(self)
			GameTooltip_SetDefaultAnchor(GameTooltip,self)
			GameTooltip:SetUnit(self.unit)
		end)
		focus:SetScript('OnLeave',function(self)
			GameTooltip:ClearLines()
			GameTooltip:Hide()
		end)
	
	local bg = focus:CreateTexture(nil,'BACKGROUND')
		bg:SetAllPoints(true)
		bg:SetTexture(unpack(c_border))
		focus.bg = bg


-- Health
	local hpbar = focus:CreateTexture(nil,'ARTWORK')
		hpbar:SetHeight(68) hpbar:SetWidth(9)
		hpbar:SetPoint('BOTTOMLEFT',1,1)
		hpbar:SetTexture(unpack(c_bar))
		hpbar:Listen('health',function(self,min,max)
			local perc = min / max
			if perc <= 0 then
				perc = .001
			elseif perc > 1 then
				perc = 1
			end
			self:SetHeight(68*perc)
		end)
		focus.hpbar = hpbar
	
	local inchealbar = focus:CreateTexture(nil,'ARTWORK')
		inchealbar:SetHeight(68) inchealbar:SetWidth(9)
		inchealbar:SetPoint('BOTTOM',hpbar,'TOP')
		inchealbar:SetTexture(.2,.6,.2)
		inchealbar:Hide()
		inchealbar:Listen('incheal',function(self,heal,min,max)
			if heal then
				self:Show()
				local def = 1 - (min / max)
				local perc = heal / max
				if perc > def then
					perc = def
				end
				if perc <= 0 then
					perc = .001
				elseif perc > 1 then
					perc = 1
				end
				self:SetHeight(68*perc)
			else
				self:Hide()
			end
		end)
		focus.inchealbar = inchealbar
	
	local hpbg = focus:CreateTexture(nil,'BORDER')
		hpbg:SetHeight(68) hpbg:SetWidth(9)
		hpbg:SetPoint('BOTTOMLEFT',1,1)
		hpbg:SetTexture(unpack(c_barbg))
		focus.hpbg = hpbg


-- Power
	local ppbar = focus:CreateTexture(nil,'ARTWORK')
		ppbar:SetHeight(68) ppbar:SetWidth(2)
		ppbar:SetPoint('BOTTOMRIGHT',-1,1)
		ppbar:SetTexture(1,1,1)
		ppbar:Listen('power',function(self,min,max)
			local perc = min / max
			if perc <= 0 then
				perc = .001
			elseif perc > 1 then
				perc = 1
			end
			self:SetHeight(68*perc)
		end)
		ppbar:Listen('class',function(self,_,enclass)
			local color = RAID_CLASS_COLORS[enclass] or white
			self:SetTexture(dim(color,.75))
		end)
		focus.ppbar = ppbar
	
	local ppbg = focus:CreateTexture(nil,'BORDER')
		ppbg:SetHeight(68) ppbg:SetWidth(2)
		ppbg:SetPoint('BOTTOMRIGHT',-1,1)
		ppbg:SetTexture(unpack(c_barbg))
		focus.ppbg = ppbg
